import { _decorator, Component, Node } from 'cc';
import { ICommandLifecycle } from './ICommandLifecycle';
import { IGuideData } from './IGuideData';
import { BaseGuideCommand } from './BaseGuideCommand';
const { ccclass, property } = _decorator;

@ccclass('GuideCommandFactory')
export class GuideCommandFactory {
    public static create<T extends BaseGuideCommand>(
        type: new (node: Node, str: IGuideData, ...args: any[]) => T, 
        node: Node, 
        str: IGuideData, 
        ...args: any[]
    ): T {
        return new type(node, str, ...args);
    }
}


